From 1f4da30ff35577403b290648cbbc8eb4039e9d8f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Fri, 28 Nov 2025 00:28:12 +0100 Subject: [PATCH] messageTray: Disconnect to global signals on destruction MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The global display object has always a longer lifetime than anything that is initialized from JS, so avoid signals that it may emit to be handled at later point. It handles issues such as: (gnome-shell:2429): Gjs-CRITICAL **: 23:18:35.025: Object Gjs_ui_messageTray_MessageTray (0x3440ed60), has been already disposed — impossible to set any property on it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs. == Stack trace for context 0x31073eb0 == #0 348db378 i resource:///org/gnome/shell/ui/messageTray.js:1046 (3a8ac3a71f60 @ 104) #1 348db2d8 i resource:///org/gnome/shell/ui/main.js:277 (3a8ac3a0b100 @ 119) Seen in: https://gitlab.gnome.org/GNOME/gnome-shell/-/jobs/5846454 Part-of: --- js/ui/messageTray.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 76c3cf989..bf8725f16 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -760,7 +760,8 @@ export const MessageTray = GObject.registerClass({ Main.layoutManager.addChrome(this); Main.layoutManager.trackChrome(this._bannerBin); - global.display.connect('in-fullscreen-changed', this._updateState.bind(this)); + global.display.connectObject('in-fullscreen-changed', + () => this._updateState(), this); Main.sessionMode.connect('updated', this._sessionUpdated.bind(this)); -- 2.39.5